using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using AC;

#if UNITY_EDITOR
using UnityEditor;
#endif

[System.Serializable]
public class ActionDialog: Action {

	public int dialogueID;
	public string dialogueName;
	public DialoguerDialogues diaDia;

	public Signal activatePanel;

	public ActionDialog(){

		this.isDisplayed = true;
		title = "Dialogue: Play Dialog";
	}

	#if UNITY_EDITOR

	override public void ShowGUI(){
		dialogueID = (int)EditorGUILayout.IntField ("Dialogue ID to play: ", dialogueID);
		diaDia = (DialoguerDialogues)EditorGUILayout.EnumPopup ("Dialogue name to play: ", diaDia);

		AfterRunningOption ();
	}

	#endif

	override public float Run(){

		if (dialogueID != null)
			Dialoguer.StartDialogue (dialogueID);
		if (dialogueName != null)
			Dialoguer.StartDialogue (diaDia);

		return 0.0f;
	}
}
